package com.baranbaygan.downloadmanager
{
	public class FileInfo
	{
		private var _url:String;
		private var _fileName:String;
		private var _fileId:String;
		private var _externalData:XML;
		
		public function get Url():String
		{
			return _url;
		}
		public function get FileName():String
		{
			return _fileName;
		}
		public function get FileId():String
		{
			return _fileId;
		}
		public function get ExternalData():XML
		{
			return _externalData;
		}	

		public function FileInfo(url:String, fileName:String, fileId:String, externalDataObj:Object=null)
		{
			_url = url;
			_fileName = fileName;
			_fileId = fileId;
			_externalData = <ExternalData/>;
			
			if(externalDataObj!=null)
			{
				for (var key:String in externalDataObj)
				{
					var keyNode:XML = <data/>;
					keyNode.key=key;
					keyNode.data=externalDataObj[key];
					_externalData.appendChild(keyNode);
				}
			}
		}
	}
}